#include <iostream>


using namespace std;


class A{
public:
    A(int ii):i(ii){
        cout << "construct" << endl;
    }

    A operator= (const A& r){
        i = r.i;
        return *this;
    }
    void print(){
        cout << i << endl;
    }
private:
    int i;
};


int main(){
    A a(1);
    A b(2);
    A c(3);
    a = b = c;
    //b.print();
    a.print();
    return 0;
}